package com.hakim.wfb.customer.enums;

/**
 * 开售标识
 * Created by caochong on 2016/6/13.
 */
public enum SaleStatusEnum {
    SALING("Y", "开售"),
    NOT_SALE("N", "停售"),
    ;

    private String code;

    private String message;

    private SaleStatusEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static SaleStatusEnum getByCode(String code) {
        if (code != null) {
            SaleStatusEnum[] codes = values();
            for (SaleStatusEnum each : codes) {
                if (each.code.equals(code)) {
                    return each;
                }
            }
        }
        return null;
    }
}
